package com.joseph.test;

import java.util.Observable;
import java.util.Observer;

/**
 * @description
 * @author Joseph_Mok
 * @date 2016年3月17日下午3:37:05
 */
public class Writer extends Observable {

	private String writerName;

	private String bookName;

	public Writer(String writerName) {
		this.writerName = writerName;
	}

	public String getWriterName() {
		return writerName;
	}

	public void setWriterName(String writerName) {
		this.writerName = writerName;
	}

	public String getBookName() {
		return bookName;
	}

	public void setBookName(String bookName) {
		this.bookName = bookName;
	}

	@Override
	public synchronized void addObserver(Observer o) {
		super.addObserver(o);
	}
	
	public void publicNewBook(String bookName) {
		this.bookName = bookName;
		setChanged();  
	    notifyObservers();  
	}

}
